#include<iostream>
using namespace std;
void sortZero(int arr[],int n){
    for(int i=1;i<=n;i++){
        if(arr[i]==0){
        //int k=1;
           //int arr2[k++]==0;
            //arr[i+1]=arr[i];
            //cout<<arr[i+1]<<endl;
            arr[n--]=arr[i];

        }else{
            cout<<arr[i]<<endl;
        }
    }
}
int main(){
int ass[19]={0,5,7,0,1,9,0,0,23,56,0,6778,6,0,12,0,0,7};
sortZero(ass,19);

}